package Book;
//书架类
public class BookList {
    Book[] books = new Book[10];//定义可以放几本书
    private int usedSize;//已有书籍的数量
    public BookList(){
        //先存入三本书
        this.books[0] = new Book("三国演义","罗贯中","小说",10);
        this.books[1] = new Book("红楼梦","曹雪芹","小说",20);
        this.books[2] = new Book("西游记","吴承恩","小说",100);
        this.usedSize = 3;
    }
    //得到 pos 位置的书
    public Book getBook(int pos){
        return books[pos];
    }
    //令 pos 位置存储 book 书
    public void setBooks(int pos,Book book){
        books[pos] = book;
    }
    //得到已有书的数量
    public int getUsedSize() {
        return usedSize;
    }
    //改变已有书的数量
    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
